package com.dlu.safe_construction.dto;

import com.dlu.safe_construction.common.CommonEnum;
import com.dlu.safe_construction.mapper.CarMapper;
import com.dlu.safe_construction.mapper.OwnerMapper;
import com.dlu.safe_construction.model.Area;
import com.dlu.safe_construction.model.Space;
import lombok.Getter;
import lombok.Setter;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * Created by  lijiaxing on 2022/3/30 16:32
 *
 * @author lijiaxing
 */
@Getter
@Setter
public class SpaceInfoDTO extends Space {

    private String ownerId;

    private String ownerName;

    private String ownerPhone;



    public static List<Space> spaceCreateList(Area area) {
        Integer flag = 1;
        List<Space> list = new ArrayList<>();
        while (flag <= area.getSpaceNum()) {
            Space space = new Space();
            space.setSpaceId(flag);
            space.setSpaceStatus(CommonEnum.SpaceStatus.NO_PARK.status);
            space.setAreaId(area.getAreaId());
            list.add(space);
            flag++;
        }
        return list;
    }
}
